Using objects in the script

One can address any report’s object from the script. So, if there are, say, the "Page1" page and the "Memo1" object, one can use them in the script, calling them by names, for example:

Memo1.Color := clRed

The list of the report’s objects available from the script is displayed in the "Report tree" service window. What objects’ properties are available in the script? The answer is simple: those ones, which are visible in the objects’ inspector. At the same time, at the bottom of the inspector, there is a hint concerning the selected property. Both windows (report’s tree and inspector) are available during working with the script. To get a detailed help about objects’ properties and methods, use the FastReport help file, which is included in distribution kit.

Let us demonstrate the aforesaid with a simple example. Put the "Text" object with the "MyTextObject" name and the "Test" text into the report’s page. Then write in the script:

begin

MyTextObject.Color := clRed

end.

Run the report and see that our object’s color became red.